import java.util.Arrays;

public class Solution2335 {
    public int fillCups(int[] amount) {
        Arrays.sort(amount);
        if (amount[2]>amount[1]+amount[0]){
            return amount[2];
        }else {
            return (amount[0]+amount[1]+amount[2]+1)/2;
        }
    }

    public static void main(String[] args) {
        System.out.println(new Solution2335().fillCups(new int[]{1,4,2}));
    }
}
